package schema

import (
	"entgo.io/ent"
	"entgo.io/ent/schema/field"
	"time"
)

// QARecord holds the schema definition for the QARecord entity.
type QARecord struct {
	ent.Schema
}

// Fields of the QARecord.
func (QARecord) Fields() []ent.Field {
	return []ent.Field{
		field.Text("question").
			NotEmpty().
			Comment("问题"),
		field.Text("answer_user1").
			Optional().
			Comment("用户1的答案"),
		field.Text("answer_user2").
			Optional().
			Comment("用户2的答案"),
		field.Time("question_date").
			Default(time.Now).
			Comment("问题日期"),
		field.Time("deleted_at").
			Optional().
			Nillable().
			Comment("软删除时间"),
		field.Time("created_at").
			Default(time.Now).
			Immutable().
			Comment("创建时间"),
		field.Time("updated_at").
			Default(time.Now).
			UpdateDefault(time.Now).
			Comment("更新时间"),
	}
}

// Edges of the QARecord.
func (QARecord) Edges() []ent.Edge {
	return nil
}
